<?php
session_start();
if(! isset($_SESSION['id'])) {
    header('Location:index.html');
}
?>
<?php 
if($_SESSION['id']!=='92'){
header('Location:index.html');
}
 ?>
<?php 
include('conn.php');
$search='';
$key=isset($_GET['key'])?$_GET['key']:'';
if($key!=''){
	$search.= " where nicheng like '%".$key."%'";
}

    $sql = "select * from user ".$search." order by id asc";
	$result = mysqli_query($conn,$sql);
	$rows = @mysqli_num_rows($result);	

	

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>账号信息</title>
    <link href="css/bootstrap.min.css" type="text/css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style>
        .div{
            position: relative;
            text-align: center;
            padding-left: 500px;
        }
        .font{
            font-size: 16px;
            font-weight: bold;;
        }
        form{
            font-weight:bold;
        }
    body {
	background-color: #F2F2F2;
}
    .2 {
	color: #FFF;
}
.sousuok {
 height:60px;
        width:300px; 
       
     



}
.sousuo {
        background: url(./images/sous.png);
        width: 51px;
        height: 51px;
        border-style: none;

    
      

    }
#zcl {
text-align: center;
background-color:#bfd0fa
}
th {
text-align: center;
line-height: 30px;
}
img{
border: 1px solid #7492f6;
}
    </style>
<script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="./js/main2.js"></script>
   

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="text-align: center; font-family: 'Comic Sans MS', cursive;">
<div align="center">
  <?php
include ("guanl.php");
?>
</div>
  <div class="btn_zhuce">
			  <form action="#" method="get" class="fl">
					 <input  class="sousuok"type="text"  name="key" value="<?php echo $key ?>"/>
					   <input class="sousuo" value="" type="submit">
			  </form>	  
		  </div>
</br>
<form action='userd.php' method='post'>
<table class="table table-bordered table-hover">

  <tr>
        <th bgcolor="#7A8BB6"><div align="center">选择</div></th>
        <th bgcolor="#7A8BB6"><div align="center">序号</div></th>
        <th bgcolor="#7A8BB6">游戏名</th>
        <th bgcolor="#7A8BB6"><div align="center">账号</div></th>
        <th bgcolor="#7A8BB6"><div align="center">密码</div></th>
        <th bgcolor="#7A8BB6"><div align="center">签名</div></th>
        <th bgcolor="#7A8BB6"><div align="center">头像</div></th>
<th bgcolor="#7A8BB6"><div align="center">操作</div></th>
    </tr>


    <?php
    //    1. 链接数据库
  
    foreach ( $conn->query($sql) as $row) {
        echo "<tr>";
       echo "<th><input type='checkbox' name='sel[]' value='".$row["id"]."'/>"."</th>";
        echo "<th>{$row['id']} </th>";
        echo "<th>{$row['nicheng']}</th>";
        echo "<th>{$row['username']} </th>";
        echo "<th>{$row['password']} </th>";
        echo "<th>{$row['qm']}</th>";
        echo "<th><img src='".$row["img"]."' width='50px', height='50px'/>"."</th>";
        echo"<td>

<a href='userg.php?id={$row['id']}'>修改</a>
</td>";
        echo "</tr>";
    }
echo "<input type='submit' name='btnDel' value='删除' onclick='return confirm(\"确定要删除选中的信息吗？\");'/>";
    ?>
</table>
</form>
</div>
</body>
</html>